<pre name="code" class="cpp"><pre name="code" class="cpp">set(CMAKE_C_COMPILER "gcc")#设置C编译器
set(CMAKE_C_FLAGS "-g -Wall  -I C:\\mingw-4.81\\mingw\\include -L C:\\mingw-4.81\\mingw\\lib")#
set(CMAKE_CXX_COMPILER "g++")#设置C++编译器
set(CMAKE_CXX_FLAGS "-g -Wall  -I C:\\mingw-4.81\\mingw\\include -L C:\\mingw-4.81\\mingw\\lib")

cmake_minimum_required(VERSION 3.20.0)
project(my_hello)
set(CMAKE_CXX_STANDARD 11)

include_directories(${PROJECT_SOURCE_DIR}/include)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC_LIST)

add_executable(
my_hello
${SRC_LIST}
)